package com.orhon.smartcampus.modules.baseinfo.mm;


import com.orhon.smartcampus.modules.base.mm.LangMapper;

import com.orhon.smartcampus.modules.baseinfo.entity.Timetable;
import com.orhon.smartcampus.modules.baseinfo.gqlModel.GQLTimetable;

import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper(
        uses = {
                LangMapper.class
        }
)
public interface TimetableMapper {

    TimetableMapper MAPPER = Mappers.getMapper(TimetableMapper.class);
    
    @Mapping(source = "id" , target = "id")
    @Mapping(source = "name" , target = "name")//lang
    @Mapping(source = "isCurrent" , target = "is_current")  
    @Mapping(ignore = true, target = "school" )
    @Mapping(ignore = true, target = "items" )
    GQLTimetable toTimetable(Timetable entity);
    
    
    @InheritConfiguration(name = "toTimetable")
    List<GQLTimetable> toTimetableList(List<Timetable> entities);



}
